POV-Ray : Newsgroups : povray.general : Color Passing in #macro : Color Passing in #macro Server Time
10 Aug 2024 15:17:20 EDT (-0400)
  Color Passing in #macro  
From: mr art
Date: 26 Nov 1999 06:42:28
Message: <383E7213.7DF63B99@gci.net>
I just ran into something strange. While trying to
pass a color vector through a macro, the color changed!
The code is simple
#include "Colors.inc"  #include "finish.inc"
#declare CapColor=<1,0,0,0,0>;
#macro Cap(Color)
difference
	{
	union	{
		cylinder{<0,0,0>,<0,.0889,0>,.17}
		cylinder{<0,.0889,0>,<0,.1333,0>,.2}
		cylinder{0,y*.0667,.12 translate y*.1333}
		}
	pigment{ rgbft Color} //Will promote to a 5 component vector
	}
#end
camera		{ location <0,5,-5> look_at 0 angle 40 }
light_source	{ 0,White translate -z*40 rotate <30,-10,0> }
background	{ White}
object		{ Cap(CapColor) }

If I #declare CapColor= a three or four component vector, it works fine.
But as a five component vector something doesn't work so well.
Can anyone give some insight on this?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.